<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="_fragment:: head(~{:: title})">
  <title>Dexter的首页</title>
</head>
<body>

  <!--导航-->
  <nav th:replace="_fragment :: menu(1)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >

  </nav>

  <!--中间内容-->
  <div  class="m-container m-padded-tb-big">

    <div class="ui container">

      <div class="ui stackable grid">

        <!--左边博客列表-->
        <div class="eleven wide column">
          <!--header-->
          <div class="ui top attached green segment">
            <div class="ui middle aligned two column grid">
              <div class="column">
                <h3 class="ui teal header">博客</h3>
              </div>
              <div class="right aligned column">
                共 <h2 class="ui orange header m-inline-block m-text-thin" th:text="${page.totalElements}"> 14 </h2> 篇
              </div>
            </div>
          </div>


          <!--content-->
          <div th:each="blog : ${page.content}" style="padding-top: 15px; border: #2e383c;">

            <div class="ui green segment">
            <div class="ui padded vertical segment m-padded-tb-large">
              <div class="ui middle aligned mobile reversed stackable grid">
                <div class="eleven wide column" >
                  <h1 class="ui header"><a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="m-black" th:text="${blog.title}">你真的理解什么是财富自由吗？</a></h1>
                  <p class="m-text" th:text="|${blog.description}......|" style="font-size: 18px">正确做好任何一件事情的前提是清晰、正确的理解目标。而事实是，我们很多人很多时候根本没有对目标正确的定义，甚至根本从来就没有想过，只是大家都那么做而已…...</p>
                  <div class="ui grid">
                    <div class="eleven wide column">
                      <div class="ui  horizontal link list">
                        <div class="item">
                          <img th:src="@{${blog.user.avatar}}" alt="" class="ui avatar image">
                          <div class="content"><a href="#" class="header" th:text="${blog.user.nickname}"></a></div>
                        </div>
                        <div class="item">
                          <i class="calendar icon" ></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}"></span>
                        </div>
                        <div class="item">
                          <i class="eye icon"></i> <span th:text="${blog.views}"></span>
                        </div>
                      </div>
                    </div>
                    <div class="right aligned five wide column">
                      <a href="#" target="_blank" class="ui teal basic label m-padded-tiny m-text-thin" th:text="${blog.type.name}">认知升级</a>
                    </div>
                  </div>
                </div>

                <div class="five wide column">
                  <a th:href="@{/blog/{id}(id=${blog.id})}"  target="_blank">
                    <img th:src="@{${blog.firstPicture}}" alt="" class="ui rounded image">
                  </a>
                </div>

              </div>
            </div>
          </div>
          </div>
          <!--footer-->
          <div class="ui bottom attached segment" th:if="${page.totalPages}>1">
            <div class="ui middle aligned two column grid">
              <div class="column">
                <a th:href="@{/(page=${page.number}-1)}" th:unless="${page.first}"  class="ui mini teal basic button">上一页</a>
              </div>
              <div class="right aligned column">
                <a th:href="@{/(page=${page.number}+1)}"  th:unless="${page.last}" class="ui mini teal basic button">下一页</a>
              </div>
            </div>
          </div>

        </div>

        <!--右边的top-->
        <div class="five wide column">

          <div class="ui special cards m-about">
            <div class="card ">
              <div class="blurring dimmable image">
                <div class="ui dimmer">
                  <div class="content">
                    <div class="center">
                      <div class="ui inverted button">添加好友</div>
                    </div>
                  </div>
                </div>
                <img th:src="@{${user.avatar}}" >
              </div>
              <div class="content">
                <a class="header">Dexter</a>
                <div class="meta">
                  <span class="date">编程热爱者</span><br/>
                  <span class="date">编程小菜鸟</span><br/>
                  <span class="date">成长虽然比别人慢了一些，但也很努力的想要开出一朵小花来！</span>
                </div>
              </div>
              <div class="extra content">
                  <a class="icon" href="https://github.com/yexiang43" target="_blank">
                    <img src="./images/github.png"  class="ui github avatar image" data-content="github" data-position="bottom center" style="width: 30px;height: 30px;margin-right: 20px">
                  </a>
                  <a class="icon" href="https://gitee.com/code__chao" target="_blank">
                    <img src="./images/gitee.png"  class="ui gitee avatar image" data-content="码云" data-position="bottom center" style="width: 30px;height: 30px;margin-right: 20px">
                  </a>
                  <a class="icon" href="https://www.jianshu.com/u/0591ffea7244" target="_blank">
                    <img src="./images/jianshu.png"  class="ui jianshu avatar image" data-content="简书" data-position="bottom center" style="width: 30px;height: 30px;margin-right: 20px">
                  </a>
                  <a class="icon"  target="_blank">
                    <img src="./images/youxiang.png"  class="ui youxiang avatar image" data-content="1736722371@QQ.com" data-position="bottom center" style="width: 30px;height: 30px;margin-right: 20px">
                  </a>
              </div>
            </div>
          </div>

          <!--&nbsp;分类-->
          <div class="ui segments">
            <div class="ui secondary segment">
              <div class="ui two column grid">
                <div class="column">
                  <i class="idea icon"></i>&nbsp;分类
                </div>
                <div class="right aligned column">
                  <a th:href="@{/types/-1}" target="_blank">more <i class="angle double right icon"></i></a>
                </div>
              </div>
            </div>
            <div class="ui teal segment">
              <div class="ui fluid vertical menu" >
                <a href="#" th:href="@{/types/{id}(id=${type.id})}" target="_blank" class="item" th:each="type : ${types} ">
                  <span th:text="${type.name}"></span>
                  <div class="ui teal basic left pointing label" th:text="${#arrays.length(type.blogs)}">13</div>
                </a>
              </div>
            </div>
          </div>

          <!--&nbsp;标签-->
          <div class="ui segments m-margin-top-large">
            <div class="ui secondary segment">
              <div class="ui two column grid">
                <div class="column">
                  <i class="tags icon"></i>&nbsp;标签
                </div>
                <div class="right aligned column">
                  <a th:href="@{/tags/-1}" target="_blank">more <i class="angle double right icon"></i></a>
                </div>
              </div>
            </div>
            <div class="ui teal segment" >
              <a href="#" th:href="@{/tags/{id}(id=${tag.id})}" target="_blank" th:each="tag : ${tags} " class="ui teal basic left pointing label m-margin-tb-tiny">
                <span th:text="${tag.name}"></span>
                <div class="detail" th:text="${#arrays.length(tag.blogs)}">23</div>
              </a>

            </div>
          </div>

          <!--最新推荐-->
          <div class="ui segments m-margin-top-large">
            <div class="ui secondary segment ">
              <i class="bookmark icon"></i>最新推荐
            </div>
            <div class="ui segment" th:each="blog : ${recommendBlogs}">
              <a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="m-black m-text-thin" th:text="${blog.title}">
              </a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <br>
  <br>
  <!--底部footer-->
  <footer class="ui inverted vertical segment m-padded-tb-massive" th:replace="_fragment:: footer ">
  </footer>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>

  <script>
    $('.menu.toggle').click(function () {
      $('.m-item').toggleClass('m-mobile-hide');
    });
    $('.github').popup();
    $('.gitee').popup();
    $('.youxiang').popup();
    $('.jianshu').popup();
  </script>
  <script>
    $('#m-index').load(/*[[@{/footer/index}]]*/"/footer/index");
  </script>
</body>
</html>